/*
*  Copyright (C) 2013 Michael Mallat michael.mallat@gmail.com
*
*  This file is part of MyTribbles
*
*  MyTribbles is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  MyTribbles is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with MyTribbles.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _TRIBBLE_H_
#define _TRIBBLE_H_

#include "main.h"

class Tribble
{
    public:
        Tribble(std::string name)
        {
            this->name = name;
            this->nAge = 0;
        }
    
        void setGene(int nIndex, int nValue)
        {
            if (nIndex < TRIBBLE_NUMGENES)
            {
                this->nGenes[nIndex] = nValue;
            }
        }
        
        void setDirection(int nDirection)
        {
            this->nDirection = nDirection;
        }

        void setAge(int nAge)
        {
            this->nAge = nAge;
        }
        
        void incrAge()
        {
            this->nAge++;
        }

        void setCoords(int nX, int nY)
        {
            this->nX = nX;
            this->nY = nY;
        }

        void setEnergy(int nEnergy)
        {
            this->nEnergy = nEnergy;
        }
        
        void decrEnergy()
        {
            this->nEnergy--;
        }

        void setName(std::string name)
        {
            this->name = name;
        }
        
        int getX() const
        {
            return nX;
        }

        int getY() const
        {
            return nY;
        }

        int getGene(int nIndex) const
        {
            return this->nGenes[nIndex];
        }

        int getAge() const
        {
            return this->nAge;
        }

        int getEnergy() const
        {
            return this->nEnergy;
        }

        std::string getName() const
        {
            return this->name;
        }
        
    private:
        std::string name;
        int nAge;
        int nEnergy;
        int nDirection;
        int nX;
        int nY;
        int nGenes[TRIBBLE_NUMGENES];
};

#endif
